import { axios } from '@/utils/request'

// 创建入库订单
export const inOrderAdd = (params, data) => {
  return axios({
    url: '/wms/wmsInOrder/add',
    method: 'post',
    params,
    data
  })
}

// 获取入库订单详情
export const inOrderInfo = (params) => {
  return axios({
    url: '/wms/wmsInOrder/queryByIdToDetails',
    method: 'get',
    params
  })
}

// 订单完成上架
export const orderGroundEnd = (data) => {
  return axios({
    url: '/wms/wmsInOrder/grounding',
    method: 'post',
    data
  })
}

// 订单删除
export const orderDelById = (params) => {
  return axios({
    url: '/wms/wmsInOrder/delete',
    method: 'delete',
    params
  })
}

// 创建出库订单
export const outOrderAdd = (data) => {
  return axios({
    url: '/wms/wmsOutOrder/add',
    method: 'post',
    data
  })
}

// 根据id查询出库订单详情
export const outOrderInfo = (params) => {
  return axios({
    url: '/wms/wmsOutOrder/queryByIdToOrderInfo',
    method: 'get',
    params
  })
}

// 完成出库扫码单暂存提交结果
export const outOrderTemporaryStorage = (data) => {
  return axios({
    url: '/wms/wmsOutOrder/commitToTemp',
    method: 'put',
    data
  })
}

// 完成出库扫码单暂存提交结果提交审核
export const outOrderSubmitExamine = (data) => {
  return axios({
    url: '/wms/wmsOutOrder/commitToExamine',
    method: 'put',
    data
  })
}

// 出库扫码单审核操作
export const outOrderExaminePass = (data) => {
  return axios({
    url: '/wms/wmsOutOrder/examineOver',
    method: 'put',
    data
  })
}

// 出库扫码单完结操作
export const outOrderComplete = (data) => {
  return axios({
    url: '/wms/wmsOutOrder/orderEnd',
    method: 'put',
    data
  })
}

// 获取出库单备货清单列表
export const queryOutOrderStockUpList = (data) => {
  return axios({
    url: '/wms/wmsOutOrderSpec/getOutProductsBySpecInfo',
    method: 'post',
    data
  })
}

// 查询入库订单轨迹
export const queryInOrderTrack = (params) => {
  return axios({
    url: '/wms/wmsLog/queryInByNo',
    method: 'get',
    params
  })
}

// 查询出库订单轨迹
export const queryOutOrderTrack = (params) => {
  return axios({
    url: '/wms/wmsLog/queryOutByNo',
    method: 'get',
    params
  })
}

// 通过箱条码查询扫码的规格信息
export const querySpecInfoByBoxBar = (params) => {
  return axios({
    url: '/wms/wmsProduct/getSpecInfoByBoxBar',
    method: 'get',
    params
  })
}

// 通过箱条码查询扫码的规格信息
export const queryEffectiveListApi = (params) => {
  return axios({
    url: '/wms/wmsPurchaseOrderDetail/effectiveList',
    method: 'get',
    params
  })
}